#!/sbin/openrc-run
# Copyright 2016-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

description="peervpn server"
pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
logfile=${logfile:-"/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"}
user=${RC_SVCNAME}
group=${RC_SVCNAME}

command="/usr/sbin/${RC_SVCNAME}"
command_args="${command_args:-/etc/peervpn/peervpn.conf}"
command_background="true"
# peervpn will drop privileges based on user and group config file settings
start_stop_daemon_args="
	--stdout ${logfile}
	--stderr ${logfile}"

depend() {
	need net
}
